import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Login',
    component: () => import(/* webpackChunkName: "about" */ '../views/Login.vue')
  },
  {
    path: '/register',
    name: 'Register',
    component: () => import(/* webpackChunkName: "about" */ '../views/Register.vue')
  },
  {
    path: '/adindex',
    name: 'ADIndex',
    component: () => import(/* webpackChunkName: "about" */ '../views/ADIndex.vue'),
    // children: [{
    //   path: '/register',
    //   name: 'Register',
    //   component: () => import(/* webpackChunkName: "about" */ '../views/Register.vue')
    // },

    // ]
  },
  {
    path: '/seindex',
    name: ' SEIndex',
    component: () => import(/* webpackChunkName: "about" */ '../views/SEIndex.vue'),
    // children: [{
    //   path: '/register',
    //   name: 'Register',
    //   component: () => import(/* webpackChunkName: "about" */ '../views/Register.vue')
    // },

    // ]
  },

    {
    path: '/index',
    name: ' Index',
    component: () => import(/* webpackChunkName: "about" */ '../views/Index.vue'),
    // children: [{
    //   path: '/register',
    //   name: 'Register',
    //   component: () => import(/* webpackChunkName: "about" */ '../views/Register.vue')
    // },

    // ]
  },

]

const router = new VueRouter({
  routes
})


// router.beforeEach((to, from, next) => {
//   if (to.meta.requireAuth) {
//     if (localStorage.getItem("userInfo") || localStorage.getItem("secretaryInfo") || localStorage.getItem("adminInfo")) {
//       next();
//     } else {
//       next({
//         path: '/',
//       })
//     }
//   } else {
//     next()
//   }
// })

export default router
